from playwright.sync_api import sync_playwright
import time

def test_A3mall_yewu():
    print("开始")
    with sync_playwright() as p:
        broswer=p.chromium.launch(headless=False)
        # 打开新的页面
        page=broswer.new_page()
        # 访问目标网址
        page.goto('http://10.59.9.12:7001/')
        time.sleep(2)
        # 进行操作
        # 点击登录
        page.click('xpath=/html/body/div[1]/div/div[2]/ul/li[1]/a')
        time.sleep(2)
        # 用户名和密码
        page.fill('xpath=//*[@id="theForm"]/div[1]/span[2]/input','13811033962')
        page.fill('xpath=//*[@id="theForm"]/div[2]/span[2]/input','123456')
        time.sleep(10)
        # 登录按钮
        page.click('xpath=//*[@id="theForm"]/div[5]/a')
        time.sleep(2)
    print("结束")